<?php
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/logic/CustomCommand.php';
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/model/factory/DaoFactory.php';
	
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/model/entity/BranchAddress.php';
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/FirePHPCore-0.3.2/lib/FirePHPCore/FirePHP.class.php';
		
	$debug = FirePHP :: getInstance(true);
	$debug -> setEnabled(true);
	
	//Permite eliminar los notices
	error_reporting (E_ALL ^ E_NOTICE);
	
	/*
	* Class to create a natural customer
	*/
	class CommandCreateBranchAddress extends CustomCommand {
		/*
		* Constructor of the class
		*/
	
		public function __construct($pkStartDate, $endDate, $pkFkRifBranch) {
				$GLOBALS['debug'] -> log($pkStartDate, "fecha inicial-------comando branch address");
			$this -> branchAddress = new BranchAddress($pkStartDate, $endDate, $pkFkRifBranch);
		}
		
		/*
		* Method to execute to create a natural customer
		*/
		public function execute() {
			$daoFactory = DaoFactory :: getMySqlDaoFactory();
			$incad = $daoFactory -> getMySqlBranchAddressAccessDao();
		  $branchAddressCreation = $incad -> createBranchAddress($this -> branchAddress);
			
			$this -> result = $branchAddressCreation;
		}
	}
?>